
package com.ojoin.trade.supplyloan_core.web.dao.impl;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.exception.DaoException;
import com.ojoin.trade.common.web.dao.impl.BaseDaoImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlPlatformRuleDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlPlatformRule;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * Created with IntelliJ IDEA. User: Administrator Date: 15-10-22 Time: 上午11:45
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class TbSlPlatformRuleDaoImpl extends BaseDaoImpl<TbSlPlatformRule>
		implements TbSlPlatformRuleDao {

    @Override
    public List<TbSlPlatformRule> getAllEnable() throws BusinessException {
        String mapMethodName = "selectAll";
        try {
            HashMap<String, Object> parammap = new HashMap<String, Object>();
            parammap.put("enable", "1");
            return this.sqlSessionTemplate.selectList(getSqlName(mapMethodName), parammap);
        } catch (Exception e) {
            throw new DaoException(String.format("查询Rule数据出错!语句：%s",
                    getSqlName(mapMethodName)), e);
        }
    }

}

